home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1996 February / EnigmA AMIGA RUN 04 (1996)(G.R. Edizioni)(IT)[!][issue 1996-02][Skylink CD III].iso / earcd / editor / words3.lha / Words / Install < prev    next >
Text File  |  1995-09-03  |  18KB  |  585 lines

  1. ; $VER: Words 3 (6 AUG 95)
  2. ; Installer script ©1995 Dietmar Eilert
  3.  
  4. (delopts "oknodelete" "force" "askuser")
  5. (complete 0)
  6.  
  7. (onerror (
  8.  
  9.     (if (> @ioerr 0) 
  10.  
  11.         " Some error has occurred. Please inform a GoldED \n"
  12.         " support site (e.g. dietmar@tomate.tng.oche.de)  \n"
  13.         " AFTER having tried a different Installer release\n"
  14.         " (1.24 is known to work fine).                   \n"
  15.     )
  16. ))
  17.  
  18. (if (exists "GOLDED:" (NOREQ))
  19.  
  20.     (
  21.         (set vernum (getversion "golded:golded"))
  22.  
  23.         (set ver (/ vernum 65536))
  24.         (set rev (- vernum (* ver 65536)))
  25.  
  26.         (set version (+ (* 10 ver) rev))
  27.  
  28.         (if (< version 30)
  29.  
  30.             (
  31.                 (message "\nSorry, GoldED 3.0.0 or better required")
  32.                 (exit (quiet))
  33.             )
  34.         )
  35.  
  36.         (if (not (exists "libs/ixemul.library"))
  37.  
  38.             (if (not (exists "libs:ixemul.library"))
  39.  
  40.                 (
  41.                     (message "\nSorry, libs:ixemul.library required.")
  42.  
  43.                     (exit (quiet))
  44.                 )
  45.             )
  46.         )
  47.  
  48.         (complete 5)
  49.  
  50.         (message (cat "\n"
  51.  
  52.             "Words 3.0 - Spell Checking Software          \n"
  53.             "                                             \n"
  54.             "Authors: Heinz Knutzen, Martin Schulz, Loren \n"
  55.             "J. Rittle, Jesper Skov, Dietmar Eilert       \n"
  56.             "                                             \n"
  57.             "Words 3.0 is a collection of spell checking  \n"
  58.             "software by various authors ready to be used \n"
  59.             "with GoldED. Commercial distribution not     \n"
  60.             "allowed. All files are the property of their \n"
  61.             "authors unless stated otherwise.             \n"
  62.             "                                             \n"
  63.             "ABOUT 4 MB RAM REQUIRED DURING INSTALLATION !\n"
  64.         ))
  65.  
  66.         (welcome)
  67.  
  68.         (complete 10)
  69.  
  70.         (set action (askoptions
  71.  
  72.             (prompt "Select parts to be installed")
  73.  
  74.             (help @askoptions-help)
  75.  
  76.             (default 1)
  77.  
  78.             (choices
  79.  
  80.                 "install binaries"
  81.                 "install German dictionary"
  82.                 "install English dictionary"
  83.             )
  84.         ))
  85.  
  86.         (complete 15)
  87.  
  88.         (if (exists "GoldED:API/SpellIT")
  89.  
  90.             (delete "GoldED:API/SpellIT/Manuel" (infos))
  91.  
  92.             (makedir "GoldED:API/SpellIT" (infos))
  93.         )
  94.  
  95.         ; install binaries
  96.  
  97.         (if (in action 0) (
  98.  
  99.             ; install syntax parser
  100.  
  101.             (copyfiles
  102.  
  103.                 (source "warpspell/parser")
  104.                 (dest "golded:syntax")
  105.                 (all)
  106.             )
  107.  
  108.             (copyfiles
  109.  
  110.                 (source "warpspell/presets")
  111.                 (dest "golded:presets")
  112.                 (all)
  113.             )
  114.  
  115.             (if (exists "golded:syntax/developer/source")
  116.  
  117.                 (if (not (exists "golded:syntax/developer/source/example_warpSPELL"))
  118.  
  119.                     (makedir "golded:syntax/developer/source/example_warpSPELL")
  120.                 )
  121.             )
  122.  
  123.             (copyfiles
  124.  
  125.                 (source "warpspell/source")
  126.                 (dest   "golded:syntax/developer/source/example_warpSPELL")
  127.                 (all)
  128.             )
  129.  
  130.             (if (exists "libs/ixemul.library")
  131.  
  132.                 ; install ixemul.library (required by ISpell)
  133.  
  134.                 (copylib
  135.  
  136.                     (prompt "Install ixemul.library ?")
  137.                     (source "libs/ixemul.library")
  138.                     (dest "libs:")
  139.                     (help @copylib-help)
  140.                     (confirm)
  141.                 )
  142.             )
  143.  
  144.             ; install ISpell & SpellIT
  145.  
  146.             (if (exists "ispell:" (quiet))
  147.  
  148.                 (set target (pathonly (expandpath "ispell:")))
  149.                 (set target "sys:")
  150.             )
  151.  
  152.             (set target (askdir
  153.  
  154.                 (prompt  (cat "\n"
  155.  
  156.                     "Where do you want to have ISpell installed ?\n"
  157.                 ))
  158.  
  159.                 (help    "A new drawer is created in the path you specify.")
  160.                 (default target)
  161.             ))
  162.  
  163.             ; $HOME is required by ISpell
  164.  
  165.             (if (= (getenv "HOME") "")
  166.  
  167.                 (run "echo >envarc:HOME sys:")
  168.             )
  169.  
  170.             (complete 20)
  171.  
  172.             (set target (tackon target "ispell"))
  173.  
  174.             (if (not (exists target))
  175.  
  176.                 (makedir target)
  177.             )
  178.  
  179.             (makeassign "ispell" target)
  180.  
  181.             (if (not (exists "ispell:bin"))
  182.                 (makedir "ispell:bin")
  183.             )
  184.  
  185.             (if (not (exists "ispell:lib"))
  186.                 (makedir "ispell:lib")
  187.             )
  188.  
  189.             (if (not (exists "ispell:doc"))
  190.                 (makedir "ispell:doc")
  191.             )
  192.  
  193.             (startup "WORDS"
  194.  
  195.                 (prompt "Add ISpell: assign to your user-startup ?")
  196.                 (help   @startup-help)
  197.                 (command ("ASSIGN >NIL: ispell: %s\nPATH ISPELL:BIN ADD" target))
  198.             )
  199.  
  200.             (copyfiles
  201.  
  202.                 (source "ISpell/doc")
  203.                 (dest   "ispell:doc")
  204.                 (all)
  205.             )
  206.  
  207.             (copyfiles
  208.  
  209.                 (source "ISpell/bin")
  210.                 (dest   "ispell:bin")
  211.                 (all)
  212.             )
  213.  
  214.             (complete 25)
  215.  
  216.             (if (not (exists "locale:" (noreq))) (
  217.  
  218.                 (if (not (exists "sys:locale")) (makedir "sys:locale"))
  219.  
  220.                 (makeassign "locale" "sys:locale")
  221.             ))
  222.  
  223.             (copyfiles
  224.  
  225.                 (source "SpellIT/locale")
  226.                 (dest "locale:")
  227.                 (all)
  228.             )
  229.  
  230.             (copyfiles
  231.  
  232.                 (source "SpellIT")
  233.                 (dest   "GoldED:API/SpellIT")
  234.                 (pattern "(Anleitung|Manual|Manuel|SpellIT|Licence|presets|#?.info)")
  235.             )
  236.  
  237.             (complete 30)
  238.  
  239.         ))
  240.  
  241.         ; install German dictionary
  242.  
  243.         (complete 35)
  244.  
  245.         (if (in action 1) (
  246.  
  247.             (set partsA (askoptions
  248.  
  249.                 (prompt "Select German dictionaries to be installed (1)")
  250.  
  251.                 (help (cat "\n"
  252.  
  253.                     " The more dictionaries you select, the more\n"
  254.                     " memory ISpell will use. File sized listed \n"
  255.                     " do NOT equal memory requirements - memory \n"
  256.                     " requirements are about three times higher.\n"
  257.                 ))
  258.  
  259.                 (choices
  260.  
  261.                     "Substantive        (250 K)"
  262.                     "Verben             (120 K)"
  263.                     "Adjektive & Co     ( 10 K)"
  264.                     "Zusammensetzungen  (550 K)"
  265.                     "Geographie         ( 15 K)"
  266.                     "Namen              (  5 K)"
  267.                     "Abkuerzungen       (  1 K)"
  268.                     "Imperative         (  1 K)"
  269.                     "Latein             (  1 K)"
  270.                 )
  271.  
  272.                 (default 503)
  273.             ))
  274.  
  275.             (complete 40)
  276.  
  277.             (set partsB (askoptions
  278.  
  279.                 (prompt "Select German dictionaries to be installed (2)")
  280.  
  281.                 (help (cat "\n"
  282.  
  283.                     " The more dictionaries you select, the more\n"
  284.                     " memory ISpell will use. File sized listed \n"
  285.                     " do NOT equal memory requirements - memory \n"
  286.                     " requirements are about three times higher.\n"
  287.                 ))
  288.  
  289.                 (choices
  290.  
  291.                     "Informatik, EDV    ( 25 K)"
  292.                     "Elektronik         ( 10 K)"
  293.                     "Organisationen     (  1 K)"
  294.                     "Marken             (  1 K)"
  295.                     "Griechisch         (  1 K)"
  296.                     "Roemische Zahlen   (  1 K)"
  297.                     "Technik            (  2 K)"
  298.                     "Seltenes           ( 10 K)"
  299.                 )
  300.  
  301.                 (default 12)
  302.             ))
  303.  
  304.             (complete 45)
  305.  
  306.             (if (or (<> partsA 0) (<> partsB 0)) (
  307.  
  308.                 (working "\nCreating dictionary, sorting entries. May take some minutes.\n")
  309.  
  310.                 (delete "dictionary/deutsch/words/all.words.cnt")
  311.                 (delete "dictionary/deutsch/words/all.words.stat")
  312.  
  313.                 (set cmd "bin/joinsorted >con://///AUTO DIR=dictionary/deutsch/words as=dictionary/deutsch/words/all.words ")
  314.  
  315.                 (if (in partsA 0) (set cmd (cat cmd "worte.txt "      )))
  316.                 (if (in partsA 1) (set cmd (cat cmd "verben.txt "     )))
  317.                 (if (in partsA 2) (set cmd (cat cmd "klein.txt "      )))
  318.                 (if (in partsA 2) (set cmd (cat cmd "adjektive.txt "  )))
  319.                 (if (in partsA 3) (set cmd (cat cmd "zusammen.txt "   )))
  320.                 (if (in partsA 4) (set cmd (cat cmd "geographie.txt " )))
  321.                 (if (in partsA 4) (set cmd (cat cmd "geogra2.txt "    )))
  322.                 (if (in partsA 5) (set cmd (cat cmd "namen.txt "      )))
  323.                 (if (in partsA 5) (set cmd (cat cmd "vornamen.txt "   )))
  324.                 (if (in partsA 5) (set cmd (cat cmd "vornam2.txt "    )))
  325.                 (if (in partsA 6) (set cmd (cat cmd "abkuerz.txt "    )))
  326.                 (if (in partsA 6) (set cmd (cat cmd "abkuerz2.txt "   )))
  327.                 (if (in partsA 7) (set cmd (cat cmd "imperat.txt "    )))
  328.                 (if (in partsA 8) (set cmd (cat cmd "latein.txt "     )))
  329.  
  330.                 (if (in partsB 0) (set cmd (cat cmd "compeng.txt "    )))
  331.                 (if (in partsB 0) (set cmd (cat cmd "infoabk.txt "    )))
  332.                 (if (in partsB 0) (set cmd (cat cmd "informatik.txt " )))
  333.                 (if (in partsB 1) (set cmd (cat cmd "elektronik.txt " )))
  334.                 (if (in partsB 2) (set cmd (cat cmd "orgabk.txt "     )))
  335.                 (if (in partsB 3) (set cmd (cat cmd "marken.txt "     )))
  336.                 (if (in partsB 4) (set cmd (cat cmd "alphabeta.txt "  )))
  337.                 (if (in partsB 5) (set cmd (cat cmd "roemisch.txt "   )))
  338.                 (if (in partsB 6) (set cmd (cat cmd "technik.txt "    )))
  339.                 (if (in partsB 7) (set cmd (cat cmd "seltenes.txt "   )))
  340.  
  341.                 (run cmd)
  342.  
  343.                 (if (exists "dictionary/deutsch/words/all.words" (noreq))
  344.  
  345.                     (
  346.                         (working "\nChecking dictionary. May take some minutes.\n")
  347.  
  348.                         (run "bin/ifilter >con://///AUTO FILE=dictionary/deutsch/words/all.words NOTEX")
  349.  
  350.                         (if (exists "ispell:lib/deutsch.hash")
  351.  
  352.                             (set remove (askbool
  353.  
  354.                                 (prompt "\nOverwrite old hash file (ispell:lib/deutsch.hash) ?")
  355.  
  356.                                 (help "You might want to backup your old file :-)")
  357.  
  358.                                 (choices
  359.  
  360.                                     "overwrite"
  361.                                     "exit"
  362.                                 )
  363.                             ))
  364.  
  365.                             (set remove 1);
  366.                         )
  367.  
  368.                         (if (= remove 1)
  369.  
  370.                             (
  371.                                 (delete "ispell:lib/deutsch.hash")
  372.  
  373.                                 (working "\nCreating hash file supporting fast data access. May take some minutes and LOTS of RAM.\n")
  374.  
  375.                                 (run "ispell/bin/buildhash >NIL: -s dictionary/deutsch/words/all.words dictionary/deutsch/words/deutsch.aff ispell:lib/deutsch.hash")
  376.  
  377.                                 (complete 60)
  378.  
  379.                                 (if (exists "ispell:lib/deutsch.hash")
  380.  
  381.                                     (
  382.                                         (copyfiles
  383.  
  384.                                             (source "dictionary/deutsch/words/deutsch.aff")
  385.                                             (dest "ispell:lib")
  386.                                         )
  387.  
  388.                                         (message (cat "\nHash file 'ispell:lib/deutsch.hash' has been created successfully. Hash file size (ISpell RAM usage):\n\n" (getsize "ispell:lib/deutsch.hash") " Bytes"))
  389.                                     )
  390.  
  391.                                     (
  392.  
  393.                                         (message "\nFatal error: hash file creation failed (out of RAM ?).\n")
  394.  
  395.                                         (delete "language/deutsch/words/all.words")
  396.  
  397.                                         (exit (quiet))
  398.                                     )
  399.                                 )
  400.                             )
  401.                         )
  402.  
  403.                         (complete 65)
  404.  
  405.                         (delete "dictionary/deutsch/words/all.words")
  406.                     )
  407.  
  408.                     (
  409.                         (message "\nFatal error - dictionary creation failed.")
  410.  
  411.                         (exit (quiet))
  412.                     )
  413.                 )
  414.             ))
  415.         ))
  416.  
  417.         ; install English dictionary
  418.  
  419.         (complete 70)
  420.  
  421.         (if (in action 2) (
  422.  
  423.             (set partsA (askoptions
  424.  
  425.                 (prompt "Select English dictionaries to install")
  426.  
  427.                 (help (cat "\n"
  428.  
  429.                     " The more dictionaries you select, the more\n"
  430.                     " memory ISpell will use. File sized listed \n"
  431.                     " do NOT equal memory requirements - memory \n"
  432.                     " requirements are about three times higher.\n"
  433.                 ))
  434.  
  435.                 (choices
  436.  
  437.                     "small       (205 KB)"
  438.                     "medium      (355 KB)"
  439.                     "large       (760 KB)"
  440.                     "extra large (  1 MB)"
  441.                 )
  442.  
  443.                 (default 2)
  444.             ))
  445.  
  446.             (complete 75)
  447.  
  448.             (if (<> partsA 0) (
  449.  
  450.                 (working "\nCreating dictionary, sorting entries. May take some minutes.\n")
  451.  
  452.                 (delete "dictionary/english/words/all.words.cnt")
  453.                 (delete "dictionary/english/words/all.words.stat")
  454.  
  455.                 (set cmd "bin/joinsorted >con://///AUTO DIR=dictionary/english/words as=dictionary/english/words/all.words ")
  456.  
  457.                 (if (> partsA 0) (set cmd (cat cmd "english.0 american.0 british.0 ")))
  458.                 (if (> partsA 1) (set cmd (cat cmd "english.1 american.1 british.1 ")))
  459.                 (if (> partsA 3) (set cmd (cat cmd "english.2 american.2 british.2 ")))
  460.                 (if (> partsA 7) (set cmd (cat cmd "english.3 ")))
  461.  
  462.                 (run cmd)
  463.  
  464.                 (if (exists "dictionary/english/words/all.words" (noreq))
  465.  
  466.                     (
  467.                         (if (exists "ispell:lib/english.hash")
  468.  
  469.                             (set remove (askbool
  470.  
  471.                                 (prompt "\nOverwrite old hash file (ispell:lib/english.hash) ?")
  472.  
  473.                                 (help "You might want to backup your old file :-)")
  474.  
  475.                                 (choices
  476.  
  477.                                     "overwrite"
  478.                                     "exit"
  479.                                 )
  480.                             ))
  481.  
  482.                             (set remove 1);
  483.                         )
  484.  
  485.                         (if (= remove 1)
  486.  
  487.                             (
  488.                                 (delete "ispell:lib/english.hash")
  489.  
  490.                                 (working "\nCreating hash file supporting fast data access. May take some minutes.\n")
  491.  
  492.                                 (run "ispell/bin/buildhash >NIL: -s dictionary/english/words/all.words dictionary/english/words/english.aff ispell:lib/english.hash")
  493.  
  494.                                 (complete 90)
  495.  
  496.                                 (if (exists "ispell:lib/english.hash")
  497.  
  498.                                     (
  499.                                         (copyfiles
  500.  
  501.                                             (source "dictionary/english/words/english.aff")
  502.                                             (dest "ispell:lib")
  503.                                         )
  504.  
  505.                                         (message (cat "\nHash file 'ispell:lib/english.hash' has been created successfully. Hash file size (ISpell RAM usage):\n\n" (getsize "ispell:lib/english.hash") " Bytes"))
  506.                                     )
  507.  
  508.                                     (
  509.                                         (message "\nFatal error: hash file creation failed (out of RAM ?).\n")
  510.  
  511.                                         (delete "dictionary/english/words/all.words")
  512.  
  513.                                         (exit (quiet))
  514.                                     )
  515.                                 )
  516.                             )
  517.                         )
  518.  
  519.                         (complete 95)
  520.  
  521.                         (delete "dictionary/english/words/all.words")
  522.                     )
  523.  
  524.                     (
  525.                         (message "\nFatal error - dictionary creation failed.")
  526.  
  527.                         (exit (quiet))
  528.                     )
  529.                 )
  530.             ))
  531.         ))
  532.  
  533.         (complete 100)
  534.  
  535.         (if (in action 0)
  536.  
  537.             (
  538.                 (if (in action 1)
  539.  
  540.                     (run (cat "gx FORCE MACRO=\"" (tackon (pathonly @icon) "auto_d.ged\"")))
  541.  
  542.                     (if (in action 2)
  543.  
  544.                         (run (cat "gx FORCE MACRO=\"" (tackon (pathonly @icon) "auto_e.ged\"")))
  545.  
  546.                         (
  547.  
  548.                             (set language (askchoice
  549.  
  550.                                 (prompt "Select dictionary you are going to use most:")
  551.  
  552.                                 (help @askoptions-help)
  553.  
  554.                                 (default 0)
  555.  
  556.                                 (choices
  557.  
  558.                                     "English dictionary"
  559.                                     "German dictionary"
  560.                                 )
  561.                             ))
  562.  
  563.                             (if (= language 0)
  564.  
  565.                                 (run (cat "gx FORCE MACRO=\"" (tackon (pathonly @icon) "auto_e.ged\"")))
  566.                                 (run (cat "gx FORCE MACRO=\"" (tackon (pathonly @icon) "auto_d.ged\"")))
  567.                             )
  568.  
  569.  
  570.                         )
  571.                    )
  572.                 )
  573.             )
  574.         )
  575.     )
  576.  
  577.     (message (cat "\n"
  578.  
  579.         " Please install GoldED Release 3+ before\n"
  580.         " attempting to install this package.    \n"
  581.     ))
  582. )
  583.  
  584. (exit (quiet))
  585.